#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableAutoChessExtraHeroPackDao:DaoBase<TableAutoChessExtraHeroPack>
    {
        public override string GetFileName()
        {
            return "TableAutoChessExtraHeroPack.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableAutoChessExtraHeroPack>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableAutoChessExtraHeroPack model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.packetId)) UnityEngine.Debug.LogError("数据表id重复:TableAutoChessExtraHeroPack->id: " + model.packetId);
            #endif
            cachePrimaryInt[model.packetId] = model;
        }
        protected override TableAutoChessExtraHeroPack ParseRowData(string[] rowData)
        {
            TableAutoChessExtraHeroPack data = new TableAutoChessExtraHeroPack();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.packetId = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.heroIds = rowData[1];
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.price = int.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.packageIcon = rowData[3];
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.packageName = rowData[4];
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.packagebg = rowData[5];
            }
            return data;
        }
    }
}
